function getValues() {
  const inpsEl = document.querySelectorAll("input");
  return Array.from(inpsEl).reduce((rets, cur) => {
    const value = +cur.value;
    rets.push(value);
    return rets;
  }, []);
}

const btnEl = document.querySelector("button");
const spanmaxEl = document.querySelector("#spanmax");
const spanminEl = document.querySelector("#spanmin");
btnEl.onclick = function () {
  const numbers = getValues();
  // const max = Math.max.apply(Math, numbers);
  spanmaxEl.innerText = Math.max(...numbers);
  spanminEl.innerText = Math.min(...numbers);
};
